package day1;

import java.util.HashMap;
import java.util.Scanner;

// https://www.nowcoder.com/practice/f0db4c36573d459cae44ac90b90c6212?tpId=182&tqId=34789&ru=/exam/oj
public class code1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.nextLine();
        String str2 = scanner.nextLine();
        HashMap<Character,Integer> hashMap = new HashMap<>();
        for (int i = 0;i < str2.length();i++) {
            if(hashMap.get(str2.charAt(i)) == null) {
                hashMap.put(str2.charAt(i),1);
            }
        }
        String ret = "";
        for (int i = 0;i < str1.length();i++) {
            if (hashMap.get(str1.charAt(i)) == null) {
                ret += str1.charAt(i);
            }
        }
        System.out.println(ret);
    }
}
